package test_11_23;

public class test11_23_1 {

        public static void main(String[] args) {
            int a = 10;
            int b = 20;
            // 调用int类型参数的add
            int ret1 = add(a, b);
            System.out.println("ret1 = " + ret1);

            // 调用double类型参数的add
            double c = 1.5;
            double d = 2.5;
            double ret2 = add(c, d);
            System.out.println("ret2 = " + ret2);
        }

        // 处理int类型的add
        public static int add(int x, int y) {
            return x + y;
        }

        // 处理double类型的add（参数列表不同，满足重载）
        public static double add(double x, double y) {
            return x + y;
        }
    }